Skip to content

Inject files into package instead of creating symlinks #147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Mar 12, 2018

Conversation

kichik
Copy link
Contributor

@kichik kichik commented Feb 28, 2018

  • symlinks are still not working properly on windows (it fails deleting them because they're actually folders)
  • IDE indexes the symlinked folders while they're there which slows things down
  • any failure, like a file being in use, causes all symlinks to be left behind

- symlinks are still not working properly on windows (it fails deleting them because they're actually folders)
- IDE indexes the symlinked folders while they're there which slows things down
- any failure, like a file being in use, causes all symlinks to be left behind
serverless#146 already takes care of this, but we need proper noDeploy here again in case a white-listed package is dependent on a black-listed package
@dschep
Copy link
Contributor

dschep commented Feb 28, 2018

Ooh. That's a good idea, I just didn't know how to implement it 😆

Seems to not be working with package individually options tho. I'll review this when i get more time.

@kichik
Copy link
Contributor Author

kichik commented Feb 28, 2018

I really have to get my test setup working... That's probably next. It won't even start on Windows 😢

@dschep
Copy link
Contributor

dschep commented Feb 28, 2018

Yeah, not sure how you'd run the tests on windows. They should be useable in WSL (or anyother way of getting bash on windows). See over here to install bats: https://github.com/sstephenson/bats

@kichik
Copy link
Contributor Author

kichik commented Feb 28, 2018

YES!!! It finally works!! 😀
Thanks for writing such a comprehensive test suite!

@dschep
Copy link
Contributor

dschep commented Feb 28, 2018

Awesome! You're welcome, its been reaaaallly useful in making it possible for me to accept PRs with confidence that I'm not breaking anything since we use this heavily at @unitedincome (that's the whole reason we wrote it)

I'll try to take a close look at this this weekend since it's a bigger change. With this and the addition of package individually, v4 will be a pretty big release 😃

Also avoid including __pycache__ where compiled noDeploy packages might remain
kichik added a commit to kichik/serverless-python-requirements that referenced this pull request Mar 3, 2018
it will need to come back once serverless#147 is merged
@dschep
Copy link
Contributor

dschep commented Mar 5, 2018

Could you update this to resolve the conflicts? Thanks.

@kichik
Copy link
Contributor Author

kichik commented Mar 10, 2018

Is there anything else I can do to help get this merged?

@dschep
Copy link
Contributor

dschep commented Mar 12, 2018

Nope, I've just been on vacation thus didn't get around to it 😉

Copy link
Contributor

@dschep dschep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally really looked at the code. looks good baring 1 question about caches


const relativeFile = path.relative(requirementsPath, file);

if (relativeFile.match(/^__pycache__[\\\/]/)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why omit caches/pyc? IIRC they're cross platform(just tied to the version of python, which should be the same) and should provide a small perf boost.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just the root __pycache__ which contains mostly six.pyc that's not deployed by default and maybe other small files. This mimics the old behavior https://github.com/UnitedIncome/serverless-python-requirements/pull/147/files#diff-0ffe4d151b22eb4ec361c9b4faaa9b11L50 and might be improved in the future.

I actually plan on trying to get rid of all .pyc files in the future with the --no-compile flag to provide more stable builds (as in building twice produces the exact same result). But there's still some more research to be done there.

@dschep dschep merged commit 95333b9 into serverless:master Mar 12, 2018
@dschep dschep mentioned this pull request Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants